package com.juyu.miliao.common.constant;

import com.juyu.miliao.common.util.DateUtil;

import java.time.LocalDate;

/**
 * @Auther: 卜加超
 * @Date: 2019/7/18 15:31
 * @Description:
 */
public class DiamondRankingListKey {

    private static final String WEEK_RANKING_DIAMOND_LIST_KEY = "DIAMOND_WEEK_RANKING_LIST:";

    private static final String DAY_RANKING_DIAMOND_LIST_KEY ="DIAMOND_DAY_RANKING_LIST:";

    /**
     * 获取通话周排行榜key
     * @param localDate
     * @return
     */
    public static String getWeekRankingListKey(LocalDate localDate){
        //当前日期是第几周
        int weeksByYear=DateUtil.getWeeksByYear(1,localDate);
        return WEEK_RANKING_DIAMOND_LIST_KEY+localDate.getYear()+":"+weeksByYear;
    }

    public static String getDayRankingListKey(LocalDate localDate){
        return DAY_RANKING_DIAMOND_LIST_KEY+localDate.toString();
    }
}
